﻿<UserControl x:Class="Reactor.Client.Views.ServiceView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:Controls1="clr-namespace:Reactor.Client.Controls" mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400">

    <Grid x:Name="LayoutRoot" Background="White" Margin="15" Width="230" Height="90">
        <Rectangle RadiusX="5" RadiusY="5" Fill="#f9f9f9" StrokeThickness="1" Stroke="Gray">
            <Rectangle.Effect>
                <DropShadowEffect Color="DarkGray" />
            </Rectangle.Effect>
        </Rectangle>
        <Canvas>
                <StackPanel Orientation="Horizontal">
                    <Image Width="12" Height="12" Margin="5" Source="{Binding Mode=OneWay, Path=StatusImage}" />
                    <TextBlock TextOptions.TextHintingMode="Animated" 
                                Text="{Binding Mode=OneTime, Path=Name}" 
                                FontWeight="Bold" VerticalAlignment="Center" />
                    <TextBlock Text="{Binding Mode=OneTime, Path=VersionDisplay}" 
                               FontSize="10" VerticalAlignment="Center" Margin="10,0,0,0" />
                </StackPanel>
                <StackPanel Orientation="Horizontal" Margin="5,25,0,0">
                    <Button>
                        <Button.Template>
                            <ControlTemplate>
                                <Image Source="{Binding Mode=OneWay, Path=PlayButtonImage}" />
                            </ControlTemplate>
                        </Button.Template>
                    </Button>
                    <Button Margin="3,0,0,0">
                        <Button.Template>
                            <ControlTemplate>
                                <Image Source="{Binding Mode=OneWay, Path=StopButtonImage}" />
                            </ControlTemplate>
                        </Button.Template>
                    </Button>
                </StackPanel>

                <Grid Margin="40,17,0,0" Height="70">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="64" />
                        <ColumnDefinition Width="64" />
                        <ColumnDefinition Width="64" />
                    </Grid.ColumnDefinitions>

                    <Controls1:BorderedImageButton 
                            HorizontalAlignment="Center" VerticalAlignment="Center"
                            Margin="3" Grid.Column="0"
                            ToolTipService.ToolTip="Orphan this service"
                            ActualCommand="{Binding Mode=OneWay, Path=OrphanCommand}"
                            ImageSource="../Images/terminal-remove.png" />
                    <Controls1:BorderedImageButton
                            HorizontalAlignment="Center" VerticalAlignment="Center"
                            Margin="3" Grid.Column="1"
                            ToolTipService.ToolTip="Transfer ownership of this service to another Reactor Core"
                            ActualCommand="{Binding Mode=OneWay, Path=TransferCommand}"
                            ImageSource="../Images/terminal-export.png" />
                    <Controls1:BorderedImageButton
                            HorizontalAlignment="Center" VerticalAlignment="Center"
                            Margin="3" Grid.Column="2"
                            ToolTipService.ToolTip="Upgrade this service to a newer version"
                            ActualCommand="{Binding Mode=OneWay, Path=UpgradeCommand}"
                            ImageSource="../Images/arrow-090.png" />
                </Grid>
            </Canvas>
    </Grid>
</UserControl>
